package cn.xz.thread_demo;

/**
 * 创建线程的方式二
 *          实现Runnable接口 重写run方法
 */
public class CreateThreadByImp implements Runnable{
    @Override
    public void run() {
        System.out.println("实现Runnable接口");
    }

    public static void main(String[] args){
        Thread thread = new Thread(new CreateThreadByImp());
        thread.start();

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
